<template>
  <div>
    <el-row>
      <el-col :span="24">
        <el-card>
          <div slot="header" class="clearfix" style="text-align: center">
            <span>今日高危</span>
          </div>

          <el-table :data="tableData" border style="width: 100%">
            <el-table-column prop="username" label="学生姓名">
            </el-table-column>
            <el-table-column prop="temperature" label="当前体温">
            </el-table-column>
            <el-table-column prop="hot" label="是否发热、咳嗽">
            </el-table-column>
            <el-table-column prop="fever" label="是否有去就诊">
            </el-table-column>
            <el-table-column prop="gohubei" label="是否去过湖北">
            </el-table-column>
            <el-table-column prop="hubeiren" label="是否为湖北人员">
            </el-table-column>
            <el-table-column prop="mask" label="是否接触过湖北人员">
            </el-table-column>
            <el-table-column prop="leaveout" label="是否离开过学校">
            </el-table-column>
            <el-table-column prop="hesuan" label="是否做过核酸检测">
            </el-table-column>
            <el-table-column prop="masknum" label="口罩数量"> </el-table-column>
            <el-table-column prop="kills" label="杀毒用品是否充足">
            </el-table-column>
          </el-table>
          <div class="block" style="text-align: center; margin-top: 20px">
            <el-pagination
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="currentPage"
              :page-sizes="[5, 10, 15, 20, 25]"
              :page-size="5"
              layout="total, sizes, prev, pager, next, jumper"
              :total="UserSize"
            >
            </el-pagination>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { getHotTmpAPI } from '../../request/users'

export default {
  data() {
    return {
      show: true,
      UserSize: 0,
      currentPage: 1,
      tableData: [],
      pageSize: 5,
      pageNo: 1,
    }
  },
  created() {
    this.getvalue(this.pageSize, this.pageNo);
  },
  filters: {
    date(time) {
      var dt = new Date(time);
      // yyyy-mm-dd
      var y = dt.getFullYear();
      var m = dt.getMonth() + 1;
      var d = dt.getDate();
      var hh = dt.getHours();
      var mm = dt.getMinutes();
      var ss = dt.getSeconds();
      return y + "-" + m + "-" + d + "  " + hh + ":" + mm + ":" + ss
    },
  },
  methods: {


    /**
     * 我的通知分页获取数据与数量
     * */
    getvalue(pageNum, currPage) {
      getHotTmpAPI({
        pageNum: pageNum,
        currPage: currPage - 1
      }).then(result => {
        this.tableData = result.data.data
        this.UserSize = result.data.total
      })
      // this.$axiosjwt({
      //   url: "/users/getHotTmp",
      //   method: "get",
      //   data: {
      //     pageNum: pageNum,
      //     currPage: currPage - 1
      //   },
      //   success: (result) => {
      //     this.tableData = result.data
      //     this.UserSize = result.total
      //   }
      // });
    },
    //分页
    handleSizeChange(val) {
      this.pageSize = val;
      this.getvalue(this.pageSize, this.pageNo)
    },
    handleCurrentChange(val) {
      this.pageNo = val;
      this.getvalue(this.pageSize, this.pageNo)
    }
  },
}
</script>

<style scoped lang="scss">
</style>
